package ch.areion.areionapp.core;

import ioio.lib.util.IOIOLooper;
import ioio.lib.util.android.IOIOActivity;
import ch.areion.areionapp.Main;
import ch.areion.areionapp.R;
import ch.areion.areionapp.communication.Monitor;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

/**
 * With this class the settings can be modified.
 * 
 * @author IljasaRedzepi
 * @version 0.1
 * 
 */
public class Settings extends IOIOActivity {
	private Button button_changeIP;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.settings);

		button_changeIP = (Button) findViewById(R.id.button_changeIP);

		button_changeIP.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				EditText edit_ip = (EditText) findViewById(R.id.changeTextIP);
				String value = edit_ip.getText().toString();
				Monitor.setHost(value);
			}
		});
	}

	@Override
	protected IOIOLooper createIOIOLooper() {
		return Main.getControllerInstance();
	}

	public void onBackPressed() {
		super.onBackPressed();
	}
}
